package com.cskaoyan.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * 请求方法限定
 * @author stone
 * @date 2022/04/29 14:47
 */
@Controller
@RequestMapping("method")
public class MethodLimitController {

    //限定请求方法为Get
    //@RequestMapping(value = "get",method = RequestMethod.GET)
    @GetMapping("get")
    @ResponseBody
    public String methodGet() {
        return "method GET";
    }
    //限定请求方法为Post
    //@RequestMapping(value = "post",method = RequestMethod.POST)
    @PostMapping("post")
    @ResponseBody
    public String methodPost() {
        return "method POST";
    }
    //限定请求方法为Get or Post
    @RequestMapping(value = "multi",method = {RequestMethod.GET,RequestMethod.POST})
    @ResponseBody
    public String methodMulti() {
        return "method MULTI";
    }

}
